using System;
using System.Reflection;
using NLog;



namespace ScriptEase.Shell
{
    internal static class Trace
    {
        public static readonly Logger Default = LogManager.GetLogger(typeof (Trace).Namespace);



        static Trace()
        {
            Default.Info("Assembly {0} v{1}", Assembly.GetExecutingAssembly().GetName().Name, Assembly.GetExecutingAssembly().GetName().Version);
        }



        public static void LogException(this Logger exceptionLogger, Exception exception)
        {
            exceptionLogger.Error(exception);
            if (exception.InnerException != null) exceptionLogger.LogException(exception.InnerException);
        }
    }
}